package ute.mvc.dao;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import ute.mvc.model.Assignment;

@Repository("assignmentDAO")
public class AssignmentDAOImpl implements AssignmentDAO{
	@Autowired
	SessionFactory sessionFactory;

	public void addAssignment(Assignment assignmnent) {
		sessionFactory.getCurrentSession().save(assignmnent);
	}

	public void updateAssignment(Assignment assignmnent) {
		sessionFactory.getCurrentSession().merge(assignmnent);
	}

	public void deleteAssignment(Assignment assignmnent) {
		sessionFactory.getCurrentSession().delete(assignmnent);
	}
}
